#include<iostream>
#include<cstdio>
#include<cstring>

void reverse (char * str)
{
    int i = 0, j = strlen(str) - 1;
    while (i < j)
    {
        char temp = str[i];
        str[i] = str[j];
        str[j] = temp;
        ++i;
        --j;
    }
}

void reverse2 (char * str)
{
    for (int i = 0, j = strlen(str) - 1; i < j; ++i, --j)
    {
        char temp = str[i];
        str[i] = str[j];
        str[j] = temp;
    }
}

void reverse3 (char * str)
{
    int i = 0;
    int j = 0;
    while (str[j] != '\0')
        ++j;

    j--;
    while (i < j)
    {
        char temp = str[i];
        str[i] = str[j];
        str[j] = temp;
        ++i;
        --j;
    }
}

int main(int argc, char ** argv)
{
    if (argc < 2)
        return 0;

    reverse3(argv[1]);
    printf("%s\n", argv[1]);
    return 0;
}
